<!DOCTYPE html>
<html class="pixel-ratio-1">

<head>
    <meta charset="utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
    <meta name="viewport" content="width=375, user-scalabe=no">
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <title>销售计划 - 列表</title>
    <link rel="stylesheet" type="text/css" href="../../../../public/vendor/weui/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../../public/css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../../public/css/iconfont/iconfont.css" />
    <link rel="stylesheet" href="../../../../public/vendor/weui/jquery-weui.css">
    <!-- Site CSS -->
    <link rel="stylesheet" href="../../../../public/themes/base/css/site.css" id="admui-siteStyle">
    <link rel="stylesheet" href="../../../../public/css/features/breedsales/saleplans/saleplanlist.css">

</head>

<body>
    <div id="vehicle-app" class="d-none">
        <!-- 搜索 -->
        <div class="weui-search-bar" id="search_bar">
            <form class="weui-search-bar__form" style="height: 35px;" @submit.prevent="search">
                <div class="weui-search-bar__box input-search">
                    <i class="weui-icon-search"></i>
                    <input type="search" v-model="queryKey" class="weui-search-bar__input ios-input-adjustment"
                        id="search-index" placeholder="请输入查询信息..." />
                    <a href="javascript:" class="weui-icon-clear" id="search_clear" @click="clearSearch"></a>
                </div>
                <label for="search_input" class="weui-search-bar__label" id="search_text">
                    <i class="weui-icon-search"></i>
                    <span>搜索</span>
                </label>
            </form>
            <a href="javascript:" class="weui-search-bar__cancel-btn" id="search_cancel" @click="clearSearch">取消</a>
        </div>
        <!-- 选项栏 -->
        <div class="weui-navbar" id="navbar" style="height: 56px;">
            <div v-for="item in navList" :key="item.value"
                :class="`weui-navbar__item ${activeNavValue === item.value ? 'weui-bar__item--on' : ''}`"
                @click="clickNav(item)">{{item.text}}</div>
        </div>
        <!-- 销售计划列表 -->
        <div id="vehicle-list" class="vehicle-list">
            <div class="vehicle-item" v-for="(item, index) in salePlanList" :key="item" @click="viewDetail(item)">
                <div class="item-content">
                    <div class="item-box">
                        <div class="billNo">{{index + 1}}：{{item.billNo}}</div>
                        <div v-html="item.billStatusHtml">{{item.billStatusHtml}}</div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div font-blue" style="color:#1baeea">
                            <span class="label"></span>
                            <span>{{item.saleOrgName}}({{item.farmOrgName}})</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">批次:</span>
                            <span>{{item.breedBatchName}}</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">猪只日龄(天):</span>
                            <span class="orange">{{item.pigDays}}</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">数量(头):</span>
                            <span class="orange">{{Utils.toThousands(item.count,0)}}</span>
                        </div>
                    </div>
                    <div class="item-box" v-if="item.checkCount">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">核定数量(头):</span>
                            <span class="orange">{{Utils.toThousands(item.checkCount,0)}}</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">均重(kg):</span>
                            <span class="orange">{{Utils.toThousands(item.avgWeight)}}</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                            <span class="label">业务日期:</span>
                            <span>{{item.bizDateStr}}</span>
                        </div>
                    </div>
                    <div class="item-box">
                        <div class="item-box-div" style="color:#4d4d4d">
                        </div>
                        <div class="operation" @click.stop="clickItemOpera(item)">
                            <svg t="1663838073483" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                xmlns="http://www.w3.org/2000/svg" p-id="2539" width="30" height="20">
                                <path
                                    d="M256 512a64 64 0 1 1-128 0 64 64 0 0 1 128 0zM576 512a64 64 0 1 1-128 0 64 64 0 0 1 128 0zM896 512a64 64 0 1 1-128 0 64 64 0 0 1 128 0z"
                                    p-id="2540"></path>
                            </svg>
                            <div v-if="showPopoverItem.id === item.id" class="operation-popover" id="operation-popover">
                                <div v-if="item.billStatus == '1'" class="operation-menu" @click="editPlan(item)">编辑
                                </div>
                                <div v-if="item.billStatus == '1'" class="operation-menu"
                                    @click="doOperation('submit', item)">提交</div>
                                <div v-if="item.billStatus == '2'" class="operation-menu"
                                    @click="doOperation('unsubmit', item)">
                                    反提交
                                </div>
                                <div v-if="item.billStatus == '2'" class="operation-menu"
                                    @click="doOperation('audit', item)">审核</div>
                                <div v-if="item.billStatus == '3'" class="operation-menu"
                                    @click="doOperation('unaudit', item)">
                                    反审核
                                </div>
                                <div class="operation-menu" @click="viewDetail(item)">查看详情</div>
                                <div v-if="item.billStatus == '1'" class="operation-menu"
                                    @click="doOperation('delete', item)">删除</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="weui-loadmore weui-loadmore_line" style="margin-top: 100px;">
                <span class="weui-loadmore__tips" style="background: #f1f1f1;">已经到底了</span>
            </div>
        </div>
        <!-- 返回主页 按钮 -->
        <div id="returnMain" class="returnHome" @click="returnHome"><i class="icon iconfont icon-pages"></i></div>
        <!-- 新增 按钮 -->
        <div id="addsalesplan" class="addsalesplan" @click="addplan">
            <i aria-hidden="true" class="icon iconfont icon-add-line icon-font-size-24 icon-click"></i>
        </div>
        <!-- 确认框 -->
        <div class="weui-mask weui-mask--visible " v-show="showDialog" @touchmove.prevent=""></div>
        <div class="weui-dialog weui-dialog--visible" v-show="showDialog" @touchmove.prevent="">
            <div class="weui-dialog__bd">
                <div class="weui-cells__group weui-cells__group_form" style="margin-top:-5px">
                    <div style="padding:5px;display:flex;justify-content: center; padding-bottom: 20px;">
                        <div>是否确认{{typeMap[operationType]}}<span
                                style="color:red">{{operatItem.billNo}}</span>单据？该操作无法撤销！</div>
                    </div>
                    <div class="weui-dialog__ft">
                        <a href="javascript:;" class="weui-dialog__btn default" @click="operationCancel">取消</a>
                        <a href="javascript:;" class="weui-dialog__btn" @click="operationConfirm">确定</a>
                    </div>
                </div>
            </div>
            <div id="date-range-picker"></div>
        </div>
    </div>
    <!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
      <script>
      // VConsole 默认会挂载到 `window.VConsole` 上
      var vConsole = new window.VConsole();
      </script> -->


    <script type="text/javascript" src="../../../../public/vendor/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../../../../public/vendor/vue/vue.min.js"></script>
    <script type="text/javascript" src="../../../../public/vendor/moment/moment.min.js"></script>
    <script type="text/javascript" src="../../../../public/vendor/weui/weui.js"></script>
    <script type="text/javascript" src="../../../../public/vendor/weui/jquery-weui.min.js"></script>
    <script type="text/javascript" src="../../../../public/js/common/iosadaptation.js"></script>
    <script type="text/javascript" src="../../../../public/js/config/utils.js"></script>
    <script type="text/javascript" src="../../../../public/vendor/swiper/swiper.js"></script>
    <!-- <script src="../../../../../public/js/common/mescroll/mescroll.min.js" type="text/javascript" charset="utf-8"></script> -->

    <script type="module" src="../../../../public/js/features/breedsales/saleplans/saleplanlist.js"></script>
</body>

</html>